//
//  Extension+UILabel.swift
//  SHWeibo3
//
//  Created by teacher on 16/7/20.
//  Copyright © 2016年 teacher. All rights reserved.
//

import UIKit

extension UILabel {
    // 便利构造函数
    convenience init(textColor: UIColor, textFont:CGFloat, maxWidth: CGFloat = 0) {
        self.init()
        self.textColor = textColor
        self.font = UIFont.systemFontOfSize(textFont)
        
        if maxWidth > 0 {
            // 设置label显示的最大宽度
            self.preferredMaxLayoutWidth = maxWidth
            self.numberOfLines = 0
        }
        
    }
}
